package com.itrus.util;

public class Semaphore
{
  boolean m_lock = false;
  int m_readCount = 0;

  public Semaphore()
  {
  }

  public Semaphore(boolean paramBoolean)
  {
    this.m_lock = paramBoolean;
  }

  public void lock()
    throws InterruptedException
  {
    try
    {
      while (true)
      {
        if (this.m_readCount <= 0)
        {
          this.m_lock = true;
          return;
        }
        wait();
      }
    }
    finally
    {
    }
  }

  public void releaseReadSemaphore()
  {
    try
    {
      this.m_readCount = (-1 + this.m_readCount);
      notifyAll();
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public void unlock()
  {
    try
    {
      this.m_lock = false;
      notifyAll();
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public void waitReadSemaphore()
    throws InterruptedException
  {
    try
    {
      while (true)
      {
        if (!this.m_lock)
        {
          this.m_readCount = (1 + this.m_readCount);
          return;
        }
        wait();
      }
    }
    finally
    {
    }
  }

  public void waitReadSemaphore(long paramLong)
    throws InterruptedException
  {
    try
    {
      this.m_readCount = (1 + this.m_readCount);
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.itrus.util.Semaphore
 * JD-Core Version:    0.6.2
 */